import React, { useState, useEffect, useRef } from 'react';

import FormAll from './components/FormAll';
export default function (props) {
  const form = useRef();
  useEffect(() => {
    // form.current.onFinish()
    // form.current.resetFields()
  });

  const [value, setValue] = useState();

  function add() {
    form.current.onFinish();
    let a = form.current.getFieldsValue();
    console.log('a', a);
  }

  const onFinish = (data) => {
    console.log('onFinish', data);
  };

  return (
    <div>
      封装 form 表单
      <FormAll ref={form} onFinish={onFinish}>
        <input />
        <button onClick={add}>111</button>
      </FormAll>
    </div>
  );
}
